]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: use global settings instead of own settings object
authorGiovanni Campagna <gcampagna@gnome.org>
Fri, 20 Mar 2015 19:56:52 +0000 (12:56 -0700)
committerGiovanni Campagna <gcampagna@gnome.org>
Fri, 27 Mar 2015 20:11:22 +0000 (13:11 -0700)
Makes it easier to reason about change notifications

https://bugzilla.gnome.org/show_bug.cgi?id=746509

js/ui/dash.js

index ba137c7ad0bae9567bcaaea6de8ecbb0d372e4f8..246bc108bdf1c05f118355b0bdf9ffc1369c0b2f 100644 (file)
@@ -242,8 +242,6 @@ const ShowAppsIcon = new Lang.Class({
     _init: function() {
         this.parent();
 
-        this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
-
         this.toggleButton = new St.Button({ style_class: 'show-apps',
                                             track_hover: true,
                                             can_focus: true,
@@ -272,7 +270,7 @@ const ShowAppsIcon = new Lang.Class({
         if (app == null)
             return false;
 
-        if (!this._settings.is_writable('favorite-apps'))
+        if (!global.settings.is_writable('favorite-apps'))
             return false;
 
         let id = app.get_id();
@@ -430,8 +428,6 @@ const Dash = new Lang.Class({
 
         this._workId = Main.initializeDeferredWork(this._box, Lang.bind(this, this._redisplay));
 
-        this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
-
         this._appSystem = Shell.AppSystem.get_default();
 
         this._appSystem.connect('installed-changed', Lang.bind(this, function() {
@@ -864,7 +860,7 @@ const Dash = new Lang.Class({
         if (app == null || app.is_window_backed())
             return DND.DragMotionResult.NO_DROP;
 
-        if (!this._settings.is_writable('favorite-apps'))
+        if (!global.settings.is_writable('favorite-apps'))
             return DND.DragMotionResult.NO_DROP;
 
         let favorites = AppFavorites.getAppFavorites().getFavorites();
@@ -943,7 +939,7 @@ const Dash = new Lang.Class({
             return false;
         }
 
-        if (!this._settings.is_writable('favorite-apps'))
+        if (!global.settings.is_writable('favorite-apps'))
             return false;
 
         let id = app.get_id();